Xbasic

Logical .AND.

IN THIS PAGE

Syntax

Result as L = Expression1 .AND. Expression2

Description

When a logical AND (.AND.) is placed between two logical expressions that evaluate to logical values, the result is TRUE only if the logical expressions on both sides of the .AND. are TRUE. This is a bitwise logical operation. The following truth table shows all the possible outcomes of an .AND. operation between two expressions that evaluate to logical values:

Using .AND.

  • If Expression1 is FALSE .AND. Expression2 is FALSE then the result is FALSE

  • If Expression1 is FALSE .AND. Expression2 is TRUE then the result is FALSE

  • If Expression1 is TRUE .AND. Expression2 is FALSE then the result is FALSE

  • If Expression1 is TRUE .AND. Expression2 is TRUE then the result is TRUE

Example

For example, if Sales contains 2000 and State is "MA":

? (SALES > 1000) .AND. (STATE = "MA")
= TRUE

<BLOB>.AND()

See Also